<!DOCTYPE html>
<script src='../../resources/js-test.js'></script>
<body>
<svg width=100 height=100>
  <rect id="rect" x=10 y=10 width=30 height=30 fill="black">
    <set attributeName="width" to="60" begin="rect.click" dur="5s" />
  </rect>
</svg>
<script>
window.jsTestIsAsync = true;
description("SMIL animations scheduled in inactive document cause crash");
debug("PASS if no crash on debug builds");

if (!window.eventSender)
    testFailed("Please run this in content_shell --run-web-tests")

var svg = document.querySelector("svg");
svg.pauseAnimations();

setTimeout(function() {
  var rect = svg.getBoundingClientRect();
  eventSender.mouseMoveTo(rect.left + 20, rect.top + 20);
  eventSender.mouseDown();
  eventSender.mouseUp();
  finishJSTest();
}, 0);
</script>
